package com.eee.xiang.market.dao.mapper;

import com.eee.xiang.market.beans.TOrderDetail;
import com.eee.xiang.market.beans.TOrderDetailExample;
import java.util.List;

import org.apache.ibatis.annotations.*;

public interface TOrderDetailMapper {
    long countByExample(TOrderDetailExample example);

    int deleteByExample(TOrderDetailExample example);

    int deleteByPrimaryKey(String detailId);

    int insert(TOrderDetail record);

    int insertSelective(TOrderDetail record);

    List<TOrderDetail> selectByExample(TOrderDetailExample example);

    TOrderDetail selectByPrimaryKey(String detailId);

    int updateByExampleSelective(@Param("record") TOrderDetail record, @Param("example") TOrderDetailExample example);

    int updateByExample(@Param("record") TOrderDetail record, @Param("example") TOrderDetailExample example);

    int updateByPrimaryKeySelective(TOrderDetail record);

    int updateByPrimaryKey(TOrderDetail record);

    @Select("select * from t_order_detail order by create_datetime desc")
    @Results({
            @Result(column = "detail_id",property = "detailId"),
            @Result(column = "order_id",property = "orderId"),
            @Result(column = "cargo_id",property = "cargoId"),
            @Result(column = "cargo_num",property = "cargoNum"),
            @Result(column = "amount",property = "amount"),
            @Result(column = "cargo_id",property = "cargo",one=@One(select = "com.eee.xiang.market.dao.mapper.TCargoMapper.selectByPrimaryKey")),
            @Result(column = "create_datetime",property = "createDatetime"),
    })
    List<TOrderDetail> getAllOrderDetailList();
}